﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports DataObject
Imports DataObject.hDBase

Public Class BusViTriCongViec

    Private ViTriCongViecDAO As New SqlServerViTriCongViec
    Private oTable As New DataTable

    Public Function GetAllViTriCongViec(ByVal sStringConnection As String) As Object
        Try
            oTable = ViTriCongViecDAO.GetAllViTriCongViec(sStringConnection)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Return oTable
    End Function

    Public Sub InsertViTriCongViec(ByVal sStringConnection As String, ByVal oViTriCongViec As ViTriCongViec)
        Try
            ViTriCongViecDAO.InsertViTriCongViec(sStringConnection, oViTriCongViec)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub UpdateViTriCongViec(ByVal sStringConnection As String, ByVal oViTriCongViec As ViTriCongViec)
        Dim bool_ As Boolean = True
        Try
            ViTriCongViecDAO.UpdateViTriCongViec(sStringConnection, oViTriCongViec)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub DeleteViTriCongViec(ByVal sStringConnection As String, ByVal oViTriCongViec As ViTriCongViec)
        Try
            ViTriCongViecDAO.DeleteTinhTrangHopDong(sStringConnection, oViTriCongViec.SoViTriCV)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

End Class
